#include "../include/header.h"
int main(int argc, char* argv[]){
	ARGS_CHECK(argc, 2);

	printf("hello1\n");

	int fd = open(argv[1], O_RDWR);
	ERROR_CHECK(fd, -1, "open");

	// 备份stdout
	int stdout_bak = 7;
	dup2(STDOUT_FILENO, stdout_bak);

	dup2(fd, STDOUT_FILENO);
	printf("hello2\n");

	dup2(stdout_bak, STDOUT_FILENO);
	printf("hello3\n");

	

	fflush(stdout);
	close(fd);
	close(stdout_bak);
	return 0;
}